import pyecharts as pye
map = pye.charts.Map()
data = [
    ("北京市",99),
    ("上海市",199),
    ("湖南省",299),
    ("台湾省",399),
    ("广东省",499)
]
map.add("牛逼地图",data,"china")
map.set_global_opts(
    visualmap_opts=pye.options.VisualMapOpts(
        is_show = True, #展示颜色块
        is_piecewise = True,
        pieces = [
            {"min": 1, "max": 9, "label": "1-9", "color": "#CCFFFF"},
            {"min": 10, "max": 99, "label": "10-99", "color": "#FF6666"},
            {"min": 100, "max": 500, "label": "100-500", "color": "#990033"}]
    )
)

pye.options.VisualMapOpts(
    is_show=True,
    is_piecewise=True,
    pieces=[
        {"min": 1, "max": 99, "lable": "1~99人", "color": "#CCFFFF"},
            {"min": 100, "max": 999, "lable": "100~9999人", "color": "#FFFF99"},
            {"min": 1000, "max": 4999, "lable": "1000~4999人", "color": "#FF9966"},
            {"min": 5000, "max": 9999, "lable": "5000~99999人", "color": "#FF6666"},
            {"min": 10000, "max": 99999, "lable": "10000~99999人", "color": "#CC3333"},
            {"min": 100000, "lable": "100000+", "color": "#990033"}
    ]
)


map.render()